FROM ubuntu:20.04
COPY sources.list /etc/apt/sources.list
RUN /bin/bash -c "useradd user; mkdir /home/user; cp /root/.bashrc /home/user; chown -R user.user /home/user;"
RUN apt update
RUN apt install -y sudo
RUN /bin/bash -c "echo 'user ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers"
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get install -y tzdata
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
RUN dpkg-reconfigure -f noninteractive tzdata

RUN apt install -y ca-certificates libncurses5 libc6-i386 lib32stdc++6 bison flex make gawk wget diffstat
RUN apt install -y unzip texinfo build-essential chrpath libsdl1.2-dev xterm subversion
RUN apt install -y cvs dos2unix lzop gcc-multilib g++-multilib libglib2.0-dev lib32gcc1 zip
RUN apt install -y lib32z1 lib32gomp1 lib32z1-dev openjdk-8-jdk filepp swig libpython2.7-dev
RUN apt install -y libbz2-dev xutils-dev libtool automake libssl-dev python-dev rsync curl kmod
RUN apt install -y python2 python-is-python2 bc git cpanminus libxml-simple-perl libtinfo5 rsync
RUN apt-get clean

USER user
RUN /bin/bash -c "\
git config --global user.email 'ohos@docker.com'; \
git config --global user.name 'ohos.docker'; \
"
CMD /bin/bash
